﻿//页面加载
$(document).ready(function () {
    $("#btnSave").bind("click", btnSave_click);
    $("#btnCancel").bind("click", btnCancel_click);
})

function btnSave_click() {

    var v_code = $("#cardCode").val();
    if (v_code == "") {
        alert("请输入卡号");
        return;
    }
    var v_OpenId = $("#OpenId").val();
    //保存绑定
    $.post("/WeChatUser/SaveBind", {openId:v_OpenId, cardCode: v_code}, function (result) {
        if (result.code == "OK") {
            alert(result.msg);
            window.location.href = "/WeChatUser/Index";
        }
        else {
            alert(result.msg);
        }
    },"json");
}

function btnCancel_click() {
    window.history.go(-1);
}